﻿// -----------------------------------------------------------------------
// <copyright file="QuickTimestamp.cs" company="Microsoft">
// TODO: Update copyright text.
// </copyright>
// -----------------------------------------------------------------------

namespace Proto.Util
{
    using System;
    using System.Collections.Generic;
    using System.Diagnostics;
    using System.Linq;
    using System.Text;

    /// <summary>
    /// TODO: Update summary.
    /// </summary>
    public static class QuickTime
    {
        static DateTime dateTime = DateTime.Now;
        static int StartTicks = Environment.TickCount;

        public static DateTime Now
        {
            get
            {
                // NOTE: Benchmarks indicate that using DateTime.Now here, we will roughly double overall cost. 
                //return DateTime.Now;
                return dateTime.AddMilliseconds(Environment.TickCount - StartTicks);
            }
        } 
    }
}
